Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add angular unit radian #49

Merged
merged 1 commit into from
Nov 28, 2017
Merged

Add angular unit radian #49

merged 1 commit into from
Nov 28, 2017

Conversation

ldrygala
Copy link
Contributor

Add angular unit radian, as referenced in #37

@codecov-io
Copy link

codecov-io commented Nov 28, 2017

Codecov Report

Merging #49 into master will increase coverage by 0.38%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #49      +/-   ##
==========================================
+ Coverage   84.68%   85.06%   +0.38%     
==========================================
  Files          10       10              
  Lines         235      241       +6     
==========================================
+ Hits          199      205       +6     
  Misses         36       36
Impacted Files Coverage Δ
src/main/scala/libra/nonsi/package.scala 100% <100%> (ø) ⬆️
src/main/scala/libra/ops/base.scala 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 255b698...383c52b. Read the comment docs.

@@ -23,7 +26,11 @@ object base {
* @tparam F the unit to convert from
* @tparam T the unit to convert to
*/
case class ConversionFactor[A, D, F <: UnitOfMeasure[D], T <: UnitOfMeasure[D]](val value: A)
case class ConversionFactor[A, D, F <: UnitOfMeasure[D], T <: UnitOfMeasure[D]](val value: A) {
def compose[OtherF <: UnitOfMeasure[D]](otherConversionFactor: ConversionFactor[A, D, OtherF, F])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really nice helper function 👍

There was a previous attempt at trying to compose conversion factors implicitly, i.e given an implicit ConversionFactor[P, Q, A, B] and an implicit ConversionFactor[P, Q, B, C], produce a ConversionFactor[P, Q, A, C]. However, this couldn't be picked up by scala's implicit resolution. I'll keep investigating, but this is a good stand in in the meantime.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also tried to make it implicitly but i failed (it was above my abilities), i'll be waiting impatiently for results of your investigation :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've created an issue to track it properly #50

@zainab-ali
Copy link
Contributor

This looks great @ldrygala! 👍

@zainab-ali zainab-ali merged commit 8f79260 into to-ithaca:master Nov 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants